package cn.ucox.web.ms.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2017/8/16.
 */
@Controller
public class HomePageController {

    @RequestMapping("/")
    @ResponseBody
    public String index(ModelMap map) {
        // 加入一个属性，用来在模板中读取
        map.addAttribute("name", "admin");
        map.addAttribute("bookTitle", "aaa");
        // return模板文件的名称，对应src/main/resources/templates/welcome.html
        return "login";
    }

    @RequestMapping("/manage")
    public String manage(ModelMap map) {
        // 加入一个属性，用来在模板中读取
        map.addAttribute("name", "admin");
        map.addAttribute("bookTitle", "aaa");
        // return模板文件的名称，对应src/main/resources/templates/welcome.html
        return "login";
    }
}
